package site.luojie.business.user.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import site.luojie.business.user.pojo.AuthToken;

/**
 * @author jie.luo
 * @since 2020/9/17
 */
@Mapper
public interface AuthTokenMapper {

    @Select("select count(1) from auth_token where token = #{token}")
    int countAuthToken(@Param("token") String token);

    @Insert("INSERT INTO auth_token(email, token) VALUES (#{token.email}, #{token.token})")
    int insertAuthToken(@Param("token") AuthToken token);
}
